package com.hmdp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * PO实体类 - 优惠券
 */
@ApiModel("优惠券 Bean")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_voucher")
public class Voucher implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", position = 1, example = "1001")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商铺id", position = 2, example = "1")
    private Long shopId;

    @ApiModelProperty(value = "代金券标题", position = 3, example = "30元代金券")
    private String title;

    @ApiModelProperty(value = "副标题", position = 4, example = "周一至周五均可使用")
    private String subTitle;

    @ApiModelProperty(value = "使用规则", position = 5, example = "全场通用\n无需预约\n可无限叠加\n不兑现、不找零\n仅限堂食")
    private String rules;

    @ApiModelProperty(value = "支付金额，单位是分", position = 6, example = "2400")
    private Long payValue;

    @ApiModelProperty(value = "抵扣金额，单位是分", position = 7, example = "3000")
    private Long actualValue;

    @ApiModelProperty(value = "类型：0-普通券；1-秒杀券", position = 8, example = "1")
    private Integer type;

    @ApiModelProperty(value = "状态：1-上架；2-下架；3-过期", position = 9, example = "1")
    private Integer status;

    @ApiModelProperty(value = "库存", position = 10, example = "100")
    @TableField(exist = false)
    private Integer stock;

    @ApiModelProperty(value = "生效时间", position = 11, example = "2023-01-01T08:00:00")
    @TableField(exist = false)
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "失效时间", position = 11, example = "2023-12-31T22:00:00")
    @TableField(exist = false)
    private LocalDateTime endTime;

    @ApiModelProperty(value = "创建时间", position = 12)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", position = 13)
    private LocalDateTime updateTime;

}
